package gov.pr.celepar.sentinela.admin.pojo;

import java.io.Serializable;

import gov.pr.celepar.sentinela.util.SentinelaUtil;

public abstract class RestricaoHora implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5062777834913657486L;

	private Long codRestricaoHora;

	private Integer horaInicio;

	private Integer horaFim;

	private Boolean diaNormal;

	private Boolean sabado;

	private Boolean domingo;

	public Long getCodRestricaoHora() {
		return this.codRestricaoHora;
	}

	public void setCodRestricaoHora(Long cod) {
		this.codRestricaoHora = cod;
	}

	public String getNomeFormatadoRestricao() {
		StringBuffer strB = new StringBuffer();
		String inicio = SentinelaUtil.getHoraFromMinutos(this.horaInicio);
		String fim = SentinelaUtil.getHoraFromMinutos(this.horaFim);
		if ((inicio != null && inicio.trim().length() > 0)
				&& (fim != null && fim.trim().length() > 0)) {
			strB.append("De ");
			strB.append(inicio);
			strB.append(" a ");
			strB.append(fim);
		} else {
			strB.append("Bloqueado para ");
		}
		strB.append(" ");
		strB.append((this.domingo) ? "Dom. " : "");
		strB.append((this.sabado) ? "Sab. " : "");
		strB.append((this.diaNormal) ? "Seg a Sex. " : "");
		return strB.toString();
	}

	public Integer getHoraInicio() {
		return this.horaInicio;
	}

	public void setHoraInicio(Integer horaInicio) {
		this.horaInicio = horaInicio;
	}

	public Integer getHoraFim() {
		return this.horaFim;
	}

	public void setHoraFim(Integer horaFim) {
		this.horaFim = horaFim;
	}

	public Boolean getDiaNormal() {
		return diaNormal;
	}

	public void setDiaNormal(Boolean diaNormal) {
		this.diaNormal = diaNormal;
	}

	public Boolean getDomingo() {
		return domingo;
	}

	public void setDomingo(Boolean domingo) {
		this.domingo = domingo;
	}

	public Boolean getSabado() {
		return sabado;
	}

	public void setSabado(Boolean sabado) {
		this.sabado = sabado;
	}

}